import axios from 'axios';
import { uploadFile } from '@/helpers/AxiosHelper';
import { TempFile } from '@/type/TempFile';
import { getAuth, getFileUploadAuth } from '.';


async function uploadTempFile(file: File): Promise<TempFile> {
    return uploadFile('/temp-files', { file }, getFileUploadAuth());
}

async function deleteTempFile(id: number): Promise<boolean> {
    return axios.delete(`/temp-files/${id}`, getAuth());
}

export default {
    uploadTempFile,
    deleteTempFile,
};
